1. Field of the Invention
This invention relates to measurement and data acquisition systems and, more particularly, to an improved sampling mechanism.
2. Description of the Related Art
Data acquisition boards may include counters used to perform several kinds of measurements. Some examples of these measurements are: pulse-width measurements; frequency and period measurements; event counting measurements; position measurements; etc. Typically, there are two modes of operation for a counter when making any of these measurements. The counter may operate in single point mode, in which (after being enabled) the counter performs a single measurement and then disables itself. Alternatively, the counter may operate in a “buffered” mode, in which the counter acquires many measurements and then may be manually disabled by the user.
In single point mode of operation, the counter may require some setup time in order to start every measurement. This overhead limits the rate at which these measurements can be taken. Also, the start of the measurement may be determined by a software command, so it is usually difficult to synchronize with other measurements. In this mode, the data transfer is relatively slow since setting up faster mechanisms is not efficient for a single point transfer.
In the buffered mode of operation, when making time related measurements, the counter may perform every measurement in a row as dictated by the input signal and the type of measurement. For example, if period measurements are performed, the counter measures every period of the input signal and generates one sample or measurement for every period of the signal. A consequence of this is that the data rate of the measurement may be dependent on the frequency of the signal to be measured.
The single point and buffered modes of operation are not ideal for several applications. For instance, in control applications, several measurements are obtained and typically these measurements are part of a tight software control loop. It is beneficial for the control loop to run as fast as possible. In control applications, the single point mode is not a good option due to the extra overhead it puts on the processor of the system. Also, the control loop may be significantly slowed down because of the slow nature of the data transfer in single point mode. Buffered mode may also not be a good fit for control applications, since the control loop usually requires data at a rate matching that of the control loop, not that of the input signal. For example, if a control loop needs to monitor a signal that has a frequency of 1 Mhz, in buffered mode this would require the control loop to run at such a high rate. Discarding data either at the data acquisition hardware or at the host computer is a cumbersome solution that slows down performance of the system.
Furthermore, neither the single point mode nor the buffered mode is a good option in the following situations: (1) When a signal needs to be monitored or measured and its frequency is higher than the desired sample rate; (2) When the data generation of sampling the signal and generating data for every period exceeds the bandwidth available in the communications channel of the data acquisition device; and (3) When the latency of the measurement is a critical parameter; etc.
Many other problems and disadvantages of the prior art will become apparent to one skilled in the art after comparing such prior art with the present invention as described herein.